package chapter_9;

public class Singleton {

    private static Singleton instance = null;
    private Singleton() {}
    // 初始化顺序：基静态、子静态 -> 基实例代码块、基构造 -> 子实例代码块、子构造
    static {
        instance = new Singleton();
    }
    public static Singleton getInstance() {
        return instance;
    }
}
